using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.InputSystem;
using UnityEngine.Serialization;
using UnityEngine.XR.Interaction.Toolkit;
using UnityEngine.XR.Interaction.Toolkit.Interactors;

public class AnimHandController : MonoBehaviour
{
    public InputActionProperty mPinchActionProperty;
    public InputActionProperty mGripActionProperty;
    public InputActionProperty mPrimaryActionProperty;
    public InputActionProperty mSecondaryActionProperty;
    public InputActionProperty mActiveActionProperty;
    private InputAction mPinchAction;
    private InputAction mGripAction;
    private InputAction mPrimaryAction;
    private InputAction mSecondaryAction;
    private InputAction mActiveAction;
    private Animator mAnim;
    void Start()
    {
        mPinchAction = mPinchActionProperty.action;
        mGripAction = mGripActionProperty.action;
        mPrimaryAction = mPrimaryActionProperty.action;
        mSecondaryAction = mSecondaryActionProperty.action;
        mActiveAction = mActiveActionProperty.action;
        mAnim = GetComponent<Animator>();
        

    }
    

    void Update()
    {
        float triggerValue = mPinchAction.ReadValue<float>();
        mAnim.SetFloat("Trigger",triggerValue);
        float gripValue = mGripAction.ReadValue<float>();
        mAnim.SetFloat("Grip",gripValue);
    }

}
